package nciae.db.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import nciae.db.pojo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT role, COUNT(*) AS count FROM users GROUP BY role")
    List<Map<String, Object>> countUserCategories();
}
